<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>LiWE: OS3 JS Lib / String Enhancements</title>
<link rel="stylesheet" href="docs.css" type="text/css" />
<script type="text/javascript" language="javascript" src="docs.js"></script>
</head>
<body onload="prepare_leftbar();">

<div id="title">
LiWE: <a href="index.html">OS3 JS Lib</a> / String Enhancements
</div>

<div id="leftbar">
</div>

<div id="main">
	<!-- {{{ Introduction -->
	<div class="block">
		<a name="form_intro" title="Introduction"/>
		<div class="title">
			Introduction
		</div>

		<div class="text">
			laskd adj alk jdlak jdlka jdkla jdkl ajkdl jakld jlka jdlka jdlka jdkla jdlk ajkld jalk djla dla djklajsdklajsdklajsd lkasjd
			kasdj sakdj aksd jkas djka jdka jdka jdka jdka jdk ajkd jaksd jaks djkasdj kadj kasjdkajdkajdkasjdka djka jdkajd
			adoaidoa dioaidoa doa idoa idoai lad lakj dlkajd laskj dlaskjd lkasjd lksaj dlkas jdlkajsd
			aosdia sod asodi asod akljd jkash duqd jqkdh qkjdhusdh akjsdajkshduasd hkajsdhsajkdh uas dkashdjakshdua hkjahd jsadh uas
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ endsWith () -->
	<div class="block">
		<a name="string_endsWith" title="String::endsWith()"/>
		<div class="title">
			String::endsWith ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">endsWith ( str )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">bool endsWith ( str )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method checks the current string against the <tt>str</tt> provided, returning
						<tt>true</tt> if the last part of the current string actually matches the <tt>str</tt>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>str</tt> - (<tt>string</tt>) The string to match the current <tt>string</tt> with.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>bool</tt> value: <tt>true</tt> if the current string actually ends with the same chars present
						inside the provided <tt>str</tt>; <tt>false</tt> otherwise.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ format ( fmt, arg1, ... ) -->
	<div class="block">
		<a name="string_format" title="String::format()"/>
		<div class="title">
			String::format ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">format ( fmt[, arg1 [, arg2 ...] ] )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">string format ( string fmt[, arg1 [, arg2 ... ] ] )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method works exactly like the standard <tt>sprintf</tt> C library function.<br />
						At the moment, it only supports the <tt>%s</tt> and <tt>%d</tt> place holders, but they should
						be enough to fulfill almost every need.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>fmt</tt> - (<tt>string</tt>) The string containing format placeholders.</li>
							<li><tt>arg1</tt> - (<tt>various</tt>) Data for placeholder 1</li>
							<li><tt>argn</tt> - (<tt>various</tt>) Data for placeholder n</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A <tt>string</tt> with all the elements in <tt>fmt</tt> replaced with given args.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ isLower () -->
	<div class="block">
		<a name="string_isLower" title="String::isLower()"/>
		<div class="title">
			String::isLower ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">isLower ( str )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">bool isLower ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method checks whether all the characters inside the current string are actually
						all <tt>lowercase</tt> chars and returns <tt>true</tt> if the check is fine.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>bool</tt> value: <tt>true</tt> if the current string is actually all lowercase.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ isUpper () -->
	<div class="block">
		<a name="string_isUpper" title="String::isUpper()"/>
		<div class="title">
			String::isUpper ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">isUpper ( str )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">bool isUpper ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method checks whether all the characters inside the current string are actually
						all <tt>UPPERCASE</tt> chars and returns <tt>true</tt> if the check is fine.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>bool</tt> value: <tt>true</tt> if the current string is actually all uppercase.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ join ( arr ) -->
	<div class="block">
		<a name="string_join" title="String::join()"/>
		<div class="title">
			String::join ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">join ( arr )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">string join ( arr )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method creates a <tt>string</tt> by joining all the elements inside the Array <tt>arr</tt>
						using the current string as separator.<br />
						For example, suppose you have an array with these elements: <tt>'one','two','three'</tt>, and you want them
						to be joined inside a string separated by ":", simply write:<br />
						<tt>':'.join ( arr );</tt> <br />
						and you'll obtain: <tt>'one:two:three'</tt>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>arr</tt> - (<tt>Array</tt>) The array to iterate the elements on.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A <tt>string</tt> with all the elements in <tt>arr</tt> joined and separated by the current string.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ LStrip () -->
	<div class="block">
		<a name="string_LStrip" title="String::LStrip()"/>
		<div class="title">
			String::LStrip ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">LStrip ()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">string LStrip ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method removes all whitespace character (space, tab, "\n", "\r") from the beginning of the current
						string and returns a <b>new string</b>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A new <tt>string</tt> with all the starting whitespaces removed.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ RStrip () -->
	<div class="block">
		<a name="string_RStrip" title="String::RStrip()"/>
		<div class="title">
			String::RStrip ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">RStrip ()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">string RStrip ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method removes all whitespace character (space, tab, "\n", "\r") from the end of the current
						string and returns a <b>new string</b>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A new <tt>string</tt> with all the ending whitespaces removed.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ startsWith () -->
	<div class="block">
		<a name="string_startsWith" title="String::startsWith()"/>
		<div class="title">
			String::startsWith ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">startsWidth ( str )</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">bool startsWith ( str )</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method checks the current string against the <tt>str</tt> provided, returning
						<tt>true</tt> if the first part of the current string actually matches the <tt>str</tt>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						<ul>
							<li><tt>str</tt> - (<tt>string</tt>) The string to match the current <tt>string</tt> with.</li>
						</ul>
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						An <tt>bool</tt> value: <tt>true</tt> if the current string actually starts with the same chars present
						inside the provided <tt>str</tt>; <tt>false</tt> otherwise.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
	<!-- {{{ Strip () -->
	<div class="block">
		<a name="string_Strip" title="String::Strip()"/>
		<div class="title">
			String::Strip ()
		</div>

		<div class="text">
			<table class="function">
				<tr>
					<td class="name" valign="top">Name:</td>
					<td class="tt">Strip ()</td>
				</tr>
				<tr>
					<td class="name" valign="top">Synopsis:</td>
					<td class="tt">string Strip ()</td>
				</tr>

				<tr>
					<td class="name" valign="top">Description:</td>
					<td class="descr">
						This method removes all whitespace character (space, tab, "\n", "\r") from the current
						string and returns a <b>new string</b>.
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Input:</td>
					<td class="descr">
						NONE
					</td>
				</tr>

				<tr>
					<td class="name" valign="top">Returns:</td>
					<td class="descr">
						A new <tt>string</tt> with all the whitespaces removed.
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- }}} -->
</div>


</body>
</html>
